package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.Scanversion;

/**
 * Mapping von einem Resultset auf ein Scanversion Objekt
 * 
 * @author Roberto Lucas
 */

public class ScanversionMapper implements RowMapper<Scanversion>, Serializable{

	private static final long serialVersionUID = 5466680799772468881L;

	public Scanversion mapRow(ResultSet rs, int rowNum) throws SQLException {
		Scanversion scanversion = new Scanversion();
		scanversion.setId(rs.getInt("scanID_pk"));
		scanversion.setNumberOfScanversion(rs.getLong("scanVersion"));
		scanversion.setScanStartTimestamp(rs.getTimestamp("scanDateStart"));
		scanversion.setScanEndeTimestamp(rs.getTimestamp("scanDateEnd"));
		return scanversion;
	}
}
